﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Recognition;

namespace Sara
{
    static class Grammars
    {
        public static GrammarBuilder TimeGrammarBuilder()
        {
            List<string> minuteChoices = new List<string>();
            for (int i = 1; i < 60; i++)
            {
                minuteChoices.Add(i.ToString("D2"));
            }

            GrammarBuilder hour = new GrammarBuilder();
            hour.Append(new Choices("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"));


            GrammarBuilder minute = new GrammarBuilder();
            minute.Append(new Choices(new Choices(minuteChoices.ToArray()), "o clock"));

            GrammarBuilder suffix = new GrammarBuilder();
            suffix.Append(new Choices("AM", "PM"));

            GrammarBuilder time = new GrammarBuilder();
            time.Append(new SemanticResultKey("Hour", hour));
            time.Append(new GrammarBuilder(new SemanticResultKey("Minute", minute), 0, 1));
            time.Append(new GrammarBuilder(new SemanticResultKey("Suffix", suffix), 0, 1));

            return time;
        }
    }
}
